import Main from "@/view/main";
// const path = '/dt-xundacloud-demo-web'

export const page401 = {
  path: "/401",
  name: "error_401",
  meta: {
    title: "401 - 未授权"
  },
  component: () => import("@/view/error-page/401.vue")
};

const layout = {
  template: "<router-view></router-view>"
};

export const page500 = {
  path: "/500",
  name: "error_500",
  meta: {
    title: "500 - 服务端错误"
  },
  component: () => import("@/view/error-page/500.vue")
};

// 作为Main组件的子页面,并且在左侧菜单显示的路由
/* eslint-disable no-new */
export const appRouter = [
  {
    path: "/",
    name: "_home",
    redirect: "/home",
    component: Main,
    meta: {
      notCache: true,
      hideInMenu: false,
      menu: true
    },
    children: [
      {
        path: "/home",
        name: "home",
        meta: {
          icon: "md-aperture",
          title: "表格页模板",
          // notCache: true,
          menu: true
        },
        component: () => import("@/view/pages/myTestTab/list")
      }
    ]
  },
    {
    path: '/',
    name: 'website',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '官网类',
      showAlways: false,
      menu: true
    },
    children: [
      {
        path: '/website',
        name: 'website',
        meta: {
          icon: 'md-aperture',
          title: '官网类',
          menu: true
        },
        component: layout,
        redirect: '/website/index',
        children: [
          {
            path: '/website/index',
            name: 'index',
            component: () => import('@/view/demo/website/index')
          }
        ]
      }
    ]
  },
  {
    path: '/',
    name: 'business',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '业务类',
      showAlways: false,
      menu: true
    },
    children: [
      {
        path: '/business',
        name: 'business',
        meta: {
          icon: 'md-aperture',
          title: '业务类',
          menu: true
        },
        component: layout,
        redirect: '/business/businessHome',
        children: [
          {
            path: '/business/businessHome',
            name: 'businessHome',
            component: () => import('@/view/demo/business/businessHome')
          }
        ]
      }
    ]
  },
  {
    path: '/',
    name: 'movie',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '影视类',
      showAlways: false,
      menu: true
    },
    children: [
      {
        path: '/movie',
        name: 'movie',
        meta: {
          icon: 'md-aperture',
          title: '影视类',
          menu: true
        },
        component: layout,
        redirect: '/movie/movieHome',
        children: [
          {
            path: '/movie/movieHome',
            name: 'movieHome',
            component: () => import('@/view/demo/movie/movieHome')
          }
        ]
      }
    ]
  },
  {
    path: '/',
    name: 'shopping',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '电商订单',
      showAlways: false,
      menu: true
    },
    children: [
      {
        path: '/shopping',
        name: 'shopping',
        meta: {
          icon: 'md-aperture',
          title: '电商订单',
          menu: true
        },
        component: layout,
        redirect: '/shopping/older',
        children: [
          {
            path: '/shopping/older',
            name: 'older',
            component: () => import('@/view/demo/shopping/older')
          }
        ]
      }
    ]
  },
  {
    path: '/',
    name: 'order',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '订单物流',
      showAlways: false,
      menu: true
    },
    children: [
      {
        path: '/order',
        name: 'order',
        meta: {
          icon: 'md-aperture',
          title: '订单物流',
          menu: true
        },
        component: layout,
        redirect: '/order/logistics',
        children: [
          {
            path: '/order/logistics',
            name: 'logistics',
            component: () => import('@/view/demo/order/logistics')
          }
        ]
      }
    ]
  },
  {
    path: '/',
    name: 'study',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '自习室',
      showAlways: false,
      menu: true
    },
    children: [
      {
        path: '/study',
        name: 'study',
        meta: {
          icon: 'md-aperture',
          title: '自习室',
          menu: true
        },
        component: layout,
        redirect: '/study/test',
        children: [
          {
            path: '/study/test',
            name: 'test',
            component: () => import('@/view/demo/study/test')
          },
          {
            path: '/study/chartsTest',
            name: 'chartsTest',
            component: () => import('@/view/demo/study/chartsTest')
          }
        ]
      }
    ]
  },
  {
    path: '/',
    name: 'features',
    component: Main,
    meta: {
      icon: 'md-aperture',
      title: '展示功能',
      showAlways: true,
      menu: true
    },
    children: [
      {
        path: '/features/department',
        name: 'department',
        meta: {
          icon: 'md-aperture',
          title: '部门管理',
          menu: true
        },
        component: layout,
        redirect: '/features/department/deptList',
        children: [
          {
            path: '/features/department/deptList',
            name: 'deptList',
            component: () => import('@/view/demo/features/department/deptList')
          },
          {
            path: '/features/department/deptAdd',
            name: 'deptAdd',
            component: () => import('@/view/demo/features/department/deptAdd')
          },
          {
            path: '/features/department/deptEdit',
            name: 'deptEdit',
            component: () => import('@/view/demo/features/department/deptEdit')
          },
          {
            path: '/features/department/deptDetails',
            name: 'deptDetails',
            component: () => import('@/view/demo/features/department/deptDetails')
          }
        ]
      },
      {
        path: '/features/personnel',
        name: 'personnel',
        meta: {
          icon: 'md-aperture',
          title: '人员管理',
          menu: true
        },
        component: layout,
        redirect: '/features/personnel/personList',
        children: [
          {
            path: '/features/personnel/personAdd',
            name: 'personAdd',
            component: () => import('@/view/demo/features/personnel/personAdd')
          },
          {
            path: '/features/personnel/personList',
            name: 'personList',
            component: () => import('@/view/demo/features/personnel/personList')
          },
          {
            path: '/features/personnel/personEdit',
            name: 'personEdit',
            component: () => import('@/view/demo/features/personnel/personEdit')
          },
          {
            path: '/features/personnel/personDetails',
            name: 'personDetails',
            component: () => import('@/view/demo/features/personnel/personDetails')
          }
        ]
      },
      {
        path: '/features/project',
        name: 'project',
        meta: {
          icon: 'md-aperture',
          title: '项目管理',
          menu: true
        },
        component: layout,
        redirect: '/features/project/proList',
        children: [
          {
            path: '/features/project/proAdd',
            name: 'proAdd',
            component: () => import('@/view/demo/features/project/proAdd')
          },
          {
            path: '/features/project/proList',
            name: 'proList',
            component: () => import('@/view/demo/features/project/proList')
          },
          {
            path: '/features/project/proEdit',
            name: 'proEdit',
            component: () => import('@/view/demo/features/project/proEdit')
          },
          {
            path: '/features/project/proDetails',
            name: 'proDetails',
            component: () => import('@/view/demo/features/project/proDetails')
          }
        ]
      },
      {
        path: '/features/depAndPerson',
        name: 'depAndPerson',
        meta: {
          icon: 'md-aperture',
          title: '部门人员关系',
          menu: true
        },
        component: layout,
        redirect: '/features/depAndPerson/deptPerson',
        children: [
          {
            path: '/features/depAndPerson/deptPerson',
            name: 'deptPerson',
            component: () => import('@/view/demo/features/depAndPerson/deptPerson')
          }
        ]
      },
      {
        path: '/features/depAndPersonAndPro',
        name: 'depAndPersonAndPro',
        meta: {
          icon: 'md-aperture',
          title: '部门人员项目',
          menu: true
        },
        component: layout,
        redirect: '/features/depAndPersonAndPro/threeTable',
        children: [
          {
            path: '/features/depAndPersonAndPro/threeTable',
            name: 'threeTable',
            component: () => import('@/view/demo/features/depAndPersonAndPro/threeTable')
          }
        ]
      },
      {
        path: '/features/tableForm',
        name: 'tableForm',
        meta: {
          icon: 'md-aperture',
          title: '部门表格+表单',
          menu: true
        },
        component: layout,
        redirect: '/features/tableForm/table',
        children: [
          {
            path: '/features/tableForm/table',
            name: 'table',
            component: () => import('@/view/demo/features/tableForm/table')
          }
        ]
      }
    ]
  }

];

export const routers = [...appRouter, page401, page500];
